{% extends 'my_blog/blog_base.html' %}
{% block content %}
    <div class="content pure-u-1 pure-u-md-3-4">
	{% if error %}<p>No Result!</p>{% endif %}
        <div>
        	{% for blogpost in blogposts %}
            <div class="posts">
                <h1 class="content-subhead">{{ blogpost.add_date }}</h1>
                <section class="post">
                    <header class="post-header">
                        <h2 class="post-title"><a href="{{blogpost.get_absolute_url}}" style="text-decoration:none;color:black;">{{ blogpost.title }}</a></h2>

                        <p class="post-meta">
                            By <a href="#" class="post-author">lwt</a> Tag:
                            {% for tag in blogpost.tags.all %}
                            <a class="post-category post-category-pure" href="javasciprt:void(0)">{{tag}}</a>
                            {% endfor %}
                        </p>
                    </header>
                </section>
            </div>
            {% endfor %}
        </div>
    </div>
	{% if blogposts.object_list and blogposts.paginator.num_pages > 1 %}
      <div>
      <ul class="pager" style="list-style-type:none;text-align:right;margin-left:60%">
      {% if blogposts.has_next %}
        <li style="float:right;margin-left:5%;"><a class="pure-button pure-button-primary" href="?page={{ blogposts.next_page_number }}">下一页</a></li>
      {% endif %}

      {% if blogposts.has_previous %}
        <li style="float:right;"><a class="pure-button pure-button-primary" href="?page={{ blogposts.previous_page_number }}">上一页</a></li>
        <br>
      {% endif %}
    <div style="clear:both;"></div>
      </ul>
      </div>
    {% endif %}
{% endblock content %}
